#include "mei_file.h"
#include "error_no.h"
#include "FileSender.h"
#include "FileReceiver.h"
#include <filesystem>


extern "C" API int sendFile(const char *path, const char *host, int port) {
    printf("开始发送文件：%s %s %d\n", path, host, port);
    if (!std::filesystem::exists(path)) {
        printf("文件不存在！\n");
        return WRONG_PATH;
    }
    FileSender(path, host, port).sendFile();
    return 0;
}

extern "C" API int recvFile(const char *path, const char *host, int port) {
    printf("开始接收文件：%s %s %d\n", path, host, port);
    FileReceiver(path, host, port).recvFile();
    return 0;
}
